package com.cskaoyan.utils;

import java.util.Random;

/**
 * @author wenkaikai
 * @since 2022/08/13 22:01
 */
public class GenerateCDK {

    public static String getRandomCDK() {
        int maxNum = 36;
        int i;
        int count = 0;
        char[] str = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
                'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
                'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
        StringBuffer CDK = new StringBuffer("");
        Random r = new Random();
        while (count < 8) {
            i = r.nextInt(maxNum);
            CDK.append(str[i]);
            count++;
        }
        return CDK.toString();
    }
}